package com.xxxx;

import com.xxxx.config.SpringConfig;
import com.xxxx.controller.UserServlet;
import com.xxxx.entity.User;
import com.xxxx.entity.vo.MessageModel;
import com.xxxx.mapper.UserMapper;
import org.apache.ibatis.annotations.Select;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.net.InetAddress;
import java.net.UnknownHostException;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfig.class)
public class test {

   @Autowired
   private UserMapper userMapper;

    @Test
    public  void getByName() {
        User admin = userMapper.queryUserByName("admin");
        System.out.println(admin);
    }
    /*public static void main(String[] args) {
        User admin = userMapper.queryUserByName("admin");
        if(admin.getUserName().equals("admin")){
            MessageModel messageModel=new MessageModel();
            messageModel.setCode(1);
            messageModel.setMsg("成功");
            messageModel.setObject(admin);
        }
    }*/


}
